package com.letao.server.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * SKU信息表对应类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sku_info")
public class SkuInfo {
    /**
     * 自增主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long Id;
    /**
     * 所属SPU的Id
     */
    private Long spuId;
    /**
     * SKU名称
     */
    private String skuName;
    /**
     * 价格
     */
    private Double price;

    private Long sales;

    private Integer bit;

    private Long stock;
    /**
     * 描述
     */
    private String descript;
    /**
     * 是否有描述图片
     */
    private String hasImage;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modifiedTime;
}
